<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
   //使用setINterval()方法设置定时器，每隔1秒输出一次"hello"
            
            setInterval(function(){
                console.log("hello");
            })
        
    //使用clearInterval()方法清除定时器
            
            var timer = setInterval(function(){
                console.log("hello");
    })
    
            clearInterval(timer);
    </script>
</body>
</html>